<script setup lang="ts">
import { onLaunch, onShow, onHide } from '@dcloudio/uni-app'
import { PAGE_PATH } from './config/constant'

//获取当前页页面，切换对应的页面
const handoffTabBar = () => {
  let path = uni.getStorageSync(PAGE_PATH)
  if (path != '') {
    uni.switchTab({ url: path })
    return
  }
  //首页路径
  uni.setStorageSync(PAGE_PATH, '/pages/index/index')
}

onLaunch(() => {
  setTimeout(() => {
    handoffTabBar()
  }, 100)
})
onShow(() => {
  console.log('App Show')
})
onHide(() => {
  console.log('App Hide')
})
</script>
<style lang="scss"></style>
